package com.southwind.springboottest.study.Java读写锁;

import java.util.HashMap;
import java.util.Map;
/**
 * @description：TODO
 * @author： HXG
 * @create： 2023/12/15 15:25
 */

public class SafeMap<K, V> {
    private Map<K, V> map = new HashMap<>();

    public synchronized void put(K key, V value) {
        map.put(key, value);
    }

    public synchronized V get(K key) {
        return map.get(key);
    }

    public synchronized void remove(K key) {
        map.remove(key);
    }
}

